package com.gnerv.sylvanas.framework.common.tools;

import java.util.UUID;

/**
 * <p>
 * UUID 工具类
 * </p>
 *
 * @author Gnerv LiGen
 */
public class UUIDTools {

    private static final String DASH = "-";

    private UUIDTools() {}

    /**
     * 小写
     *
     * @return uuid
     */
    public static String lower() {
        return uuidToString().toLowerCase();
    }

    /**
     * 小写 去中横线
     *
     * @return uuid
     */
    public static String lowerShort() {
        return lower().replace(DASH, "");
    }

    /**
     * 大写
     *
     * @return uuid
     */
    public static String upper() {
        return uuidToString().toUpperCase();
    }

    /**
     * 大写 去中横线
     *
     * @return uuid
     */
    public static String upperShort() {
        return upper().replace(DASH, "");
    }

    public static String uuidToString() {
        return uuid().toString();
    }

    public static UUID uuid() {
        return UUID.randomUUID();
    }

    public static void main(String[] args) {
        // "62d37ef5-d706-4f25-8e02-8603af7f3d65"
        String string = lower();
        System.out.println(string);
        string = upper();
        System.out.println(string);
        string = lowerShort();
        System.out.println(string);
        string = upperShort();
        System.out.println(string);
    }

}
